<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@include file="/WEB-INF/jsp/common/taglibs.jsp" %>
<html>
<head>
    <%--<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9"/>--%>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <link rel="stylesheet" href="${ctx}/static/bootstrap/css/bootstrap.modified.css" type="text/css"/>
    <%@include file="/WEB-INF/jsp/common/common.jsp" %>

    <title>${title}</title>
    <style>
        .l_width ul .glyphicon {
            color: #ffffff;
            text-indent: 6px;
            top: -1px;
        }
    </style>
</head>
<body>
<div class="main_content">
    <div class="left_nav l_width">
        <h3 class="main_title l_width dis_inBlock">
            公文OA管理系统
        </h3>
        <ul>
            <c:forEach items="${user.resources}" var="data">
                <li title="${data.value.group.memo}">
                    <a class="${data.value.group.icon}" href="#">
                            ${data.value.group.name}
                        <p class="nav_icon_down"></p>
                    </a>
                    <ul class="sub_nav">
                        <c:forEach items="${data.value.items}" var="resource">
                            <li title="${resource.memo}">
                                <a href="${ctx}${resource.url}" target="iframe">
                                    <span class="glyphicon ${resource.icon != null && fn:containsIgnoreCase(resource.icon, 'glyphicon') ?resource.icon: 'glyphicon-list-alt'}"></span>
                                        ${resource.name}
                                </a>
                            </li>
                        </c:forEach>
                    </ul>
                </li>
            </c:forEach>
        </ul>
    </div>
    <div class="right_content">
        <ul class="main_nav">
            <li class="nav_logout dis_inBlock"><a href="${ctx}/logout.html">logout</a>
            </li>
            <li class="nav_psw"><a class="change_psw_btn" href="#">修改密码</a></li>
            <li class="nav_pers"><a>${user.roleData.name} - ${user.nickName}，您好！</a></li>
        </ul>
        <div>
            <ul class="nav_bar">
                <li id="${ctx}/static/home.html" class="active">
                    <span class="bar">主页</span>
                </li>
            </ul>
            <div class="iframe_box">
                <iframe name="iframe" frameborder=0 marginheight=0 marginwidth=0 src="${ctx}/static/home.html?_<%=System.currentTimeMillis()%>">
                </iframe>
            </div>
        </div>
    </div>
</div>
<div id="footer">
    <span>版本: ${VERSION}</span>
</div>
<script>
    window.BasePath = "${ctx}";
    function toggleList() {
        $(".left_nav .sub_nav").hide();
        $(".nav_icon_down").attr("class", "nav_icon_up");
        $(".left_nav > ul > li > a").click(function () {
            a = $(this);
            $(".nav_icon_down").attr("class", "nav_icon_up");
            var subNavShowFlag = a.parent().find(".sub_nav").css('display') == "block";
            $(".left_nav .sub_nav").hide();
            if (subNavShowFlag) {
                a.find(".nav_icon_down").attr("class", "nav_icon_up");
                a.parent().find(".sub_nav").hide();
            }
            else {
                a.find(".nav_icon_up").attr("class", "nav_icon_down");
                a.parent().find(".sub_nav").show();
            }
        });
    }

</script>

<%@include file="/WEB-INF/jsp/password.jsp" %>
<link rel="stylesheet" href="${ctx}/static/plugin/nav.bar/style.css" type="text/css"/>
<script src="${ctx}/static/plugin/nav.bar/nav.js"></script>

</body>
</html>
